
<?php 
/* 
Template Name: process_load_user_nguoi_dung_la_admin- ajax 
*/
?>
<?php 
if ( ! current_user_can( 'list_users' ) ) 
    {
      wp_die( __( 'bạn không có quyền truy cập trang này! ' ) );

            global $current_user;
            get_currentuserinfo();
    }//if ( ! current_user_can( 'list_users' ) ) 
    else {  
        if (isset($_POST['IDuser'])) 
                      {
                        $iduser = $_POST['IDuser'] ;
                        $idmayng = $_POST['idmayngdung'] ;

                        $sql = "SELECT wp_user_wp_may.ID,wp_user_wp_may.id_may,wp_users.ID,wp_users.user_login
                                FROM wp_user_wp_may
                                INNER JOIN wp_users
                                ON wp_users.ID = wp_user_wp_may.ID
                                WHERE wp_user_wp_may.ID = ".$iduser ;
                                // ." AND wp_user_wp_may.id_may =".$idmayng ;
                        //var_dump($sql);
                        $row = $wpdb->get_results($sql);
                        //var_dump($row);
                        $json = json_encode($row);
                          echo $json;
                      }//if (isset($_POST['idmay'])) 
 } //elseif ( ! current_user_can( 'list_users' ) )  ?>
    
